package com.xcity.game.task.condition;

import java.util.ArrayList;
import java.util.List;

import com.alibaba.fastjson.annotation.JSONField;
import com.xcity.game.item.ItemInfo;
import com.xcity.game.task.TaskCondition;
import com.xcity.game.task.TaskTemplate;

public class GetItemTaskCondition extends TaskCondition {

	@JSONField(serialize = false)
	protected List<ItemInfo> items;
	
	public GetItemTaskCondition(TaskTemplate template) {
		super(template);
		int[] conds = template.getConditions();
		items = new ArrayList<ItemInfo>();
		for (int i = 0; i < conds.length; i += 2) {
			items.add(new ItemInfo(conds[i], conds[i + 1]));
		}
	}

	public List<ItemInfo> getItems() {
		return items;
	}

	public void setItems(List<ItemInfo> items) {
		this.items = items;
	}

	@Override
	public int toClientCond() {
		return 0;
	}

}
